<template>
	<view class="contina">
		<view class="box w">
			<view class="title">发票信息</view>
			<view class="content">
				<view class="item">
					<view class="label">发票类型</view>
					<view class="value">电子发票</view>
				</view>
				<view class="item">
					<view class="label">开票类型</view>
					<view class="value">{{item.type}}</view>
				</view>
				<view class="item">
					<view class="label">公司名称</view>
					<view class="value">{{item.corp_name}}</view>
				</view>
				<view class="item">
					<view class="label">纳税人识别号</view>
					<view class="value">{{item.taxpayer_no}}</view>
				</view>
				<view class="item">
					<view class="label">开票金额</view>
					<view class="value">¥{{item.amount}}</view>
				</view>
				<view class="item">
					<view class="label">公司地址</view>
					<view class="value">{{item.address}}</view>
				</view>
				<view class="item">
					<view class="label">联系电话</view>
					<view class="value">{{item.phone}}</view>
				</view>
				<view class="item">
					<view class="label">开户行</view>
					<view class="value">{{item.open_bank}}</view>
				</view>
				<view class="item">
					<view class="label">银行账号</view>
					<view class="value">{{item.bank_account}}</view>
				</view>
			</view>
		</view>
		<view class="box w" style="margin-top: 20rpx;">
			<view class="title">接收方式</view>
			<view class="content">
				<view class="item">
					<view class="label">电子邮箱</view>
					<view class="value">{{item.email}}</view>
				</view>
			</view>
		</view>
		<view class="box w" style="margin-top: 20rpx;">
			<view class="title">订单记录</view>
			<view class="content">
				<view class="item flex_a_c" style="justify-content: space-between;" @click="toPath">
					<view class="label">{{item.order_id.length}}条订单记录</view>
					<image src="../../static/image/back.png" style="width: 16rpx;
				height: 32rpx;" />
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				id: 0,
				item: {
					order_id: []
				}
			};
		},
		onLoad(option) {
			this.id = option.id
		},
		onShow() {
			this.$api.corpPayInvoiceApi.detail({
				id: this.id
			}).then(res => {
				this.item = res
			})
		},
		methods: {
			toPath() {
				uni.navigateTo({
					url: '/pagesB/orderlist/orderlist?ids='+this.item.order_id.join(',')
				});
			},
		}
	}
</script>

<style lang="scss">
	.box {
		padding: 30rpx;
		background-color: #fff;

		.title {
			font-size: 32rpx;
			font-weight: 400;
			color: #000000;
		}

		.content {
			margin-top: 30rpx;

			.item {
				display: flex;
				margin-bottom: 30rpx;

				.label {
					width: 208rpx;
					font-size: 28rpx;
					color: #666;
				}

				.value {
					font-size: 28rpx;
					color: #333;
				}
			}

			.item:last-child {
				margin-bottom: 0;
			}
		}
	}
</style>